<html>
<head><meta charset="utf-8"><title>Clarification on #52234 · t-lang/meta · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/index.html">t-lang/meta</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/topic/Clarification.20on.20.2352234.html">Clarification on #52234</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="190304888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196563-t-lang/meta/topic/Clarification%20on%20%2352234/near/190304888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chase Wilson <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/topic/Clarification.20on.20.2352234.html#190304888">(Mar 11 2020 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> I commented on the <a href="https://github.com/rust-lang/rust/pull/52234#issuecomment-597510768" target="_blank" title="https://github.com/rust-lang/rust/pull/52234#issuecomment-597510768">github issue</a> but didn't want to clog it with discussion, I just don't understand how to actually bring what you said into practice. My setup is something like this:</p>
<div class="codehilite"><pre><span></span><span class="n">macro_rules</span><span class="o">!</span><span class="w"> </span><span class="n">generate_macro</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">()</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="cp">#[macro_export]</span><span class="w"></span>
<span class="w">        </span><span class="n">macro_rules</span><span class="o">!</span><span class="w"> </span><span class="n">new_macro</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">()</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{};</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">};</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="cp">#[macro_export]</span><span class="w"></span>
<span class="n">macro_rules</span><span class="o">!</span><span class="w"> </span><span class="n">use_generated_macro</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">()</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="cp">$crate</span>::<span class="n">new_macro</span><span class="o">!</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="p">};</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>So that triggers the <code>macro_expanded_macro_exports_accessed_by_absolute_paths</code> error, as it should. Problem is, I don't know how to work with/around that limitation</p>



<a name="190316707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196563-t-lang/meta/topic/Clarification%20on%20%2352234/near/190316707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/topic/Clarification.20on.20.2352234.html#190316707">(Mar 11 2020 at 18:41)</a>:</h4>
<blockquote>
<p>Problem is, I don't know how to work with/around that limitation</p>
</blockquote>



<a name="190316763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196563-t-lang/meta/topic/Clarification%20on%20%2352234/near/190316763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/topic/Clarification.20on.20.2352234.html#190316763">(Mar 11 2020 at 18:42)</a>:</h4>
<p>By referring to <code>new_macro</code> by a relative name.</p>



<a name="190316786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196563-t-lang/meta/topic/Clarification%20on%20%2352234/near/190316786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/topic/Clarification.20on.20.2352234.html#190316786">(Mar 11 2020 at 18:42)</a>:</h4>
<p>In the same crate that defines it.</p>



<a name="190316901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196563-t-lang/meta/topic/Clarification%20on%20%2352234/near/190316901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/topic/Clarification.20on.20.2352234.html#190316901">(Mar 11 2020 at 18:43)</a>:</h4>
<p>(For wg-meta this is probably an off-topic, this conversation can be moved to general, if possible.)</p>



<a name="190317194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/196563-t-lang/meta/topic/Clarification%20on%20%2352234/near/190317194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/196563-t-lang/meta/topic/Clarification.20on.20.2352234.html#190317194">(Mar 11 2020 at 18:46)</a>:</h4>
<blockquote>
<p>By referring to <code>new_macro</code> by a relative name in the same crate that defines it.</p>
</blockquote>
<p>It may cause some ugliness, but that's the only way to avoid this limitation right now.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>